f n x =(n**x)/product[1..x]

a n=n-(f n 3)+(f n 5)-(f n 7)+(f n 9)
b n=1-(f n 2)+(f n 4)-(f n 6)+(f n 8)
main = do
 c<-getContents
 let ns=map read$tail$lines c;xs=map a ns;ys=map b ns
 mapM print $concat$map(\(x,y) -> [x,y])$zip xs ys